package com.ylfstu;

/**
 * @author:Joy_Yang
 * @date:2022/9/26
 * @version:1.0
 */
public class Homework04 {
    public static void main(String[] args) {
        CellPhone cellPhone = new CellPhone();
        cellPhone.testWork(new ComputerInterface() {
            @Override
            public void work() {
                System.out.println("正在计算work方法...");
            }
        });
    }
}

interface ComputerInterface{
    void work();
}
class CellPhone {
    public void testWork(ComputerInterface computerInterface) {
        computerInterface.work();
    }
}
